package com.oracle.dao;

import com.oracle.beans.CheckItem;
import com.oracle.beans.QueryPageVo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface CheckItemMapper {
    public List<CheckItem> findList(QueryPageVo vo);

    @Insert("insert into t_checkitem values(null,#{code},#{name},#{sex},#{age},#{price},#{type}," +
            "#{attention},#{remark})")
    Integer add(CheckItem checkItem);

    @Update("update t_checkitem set code =#{code},name=#{name},sex=#{sex}," +
            "age=#{age},price=#{price},type=#{type},attention=#{attention},remark=#{remark}" +
            "where id=#{id}")
    Integer update(CheckItem checkItem);

    @Delete("delete from t_checkitem where id=#{id}")
    Integer dalete(Integer id);

    @Select("select * from t_checkitem where id in(select checkitem_id from t_checkgroup_checkitem where" +
            "checkgroup_id=#{checkgroupId})")
    List<CheckItem> findCheckitemsByCheckGroupId(Integer checkgroupId);


}
